package com.db.priceApp.domain;

import com.db.priceApp.service.PriceGenerator;

public class Price {

	private float price;
	private int rangeFrom;
	private int rangeTo;
	

	public Price(float price, int rangeFrom, int rangeTo) {
		
		this.price = price;
		this.rangeFrom = rangeFrom;
		this.rangeTo = rangeTo;
	}	
	
	public Price(int rangeFrom, int rangeTo) {
		
		this(PriceGenerator.generatePrice(rangeFrom, rangeTo), rangeFrom, rangeTo);
	}	
	
	public float getPrice() {
		return price;
	}
	
	public int getRangeFrom() {
		return rangeFrom;
	}
	
	public int getRangeTo() {
		return rangeTo;
	}

	@Override
	public String toString() {
		return Float.toString(price);
	}

}
